﻿@model Doan.Website.Models.News
@using Ext.Net
@using Ext.Net.MVC
@{
    ViewBag.Title = "Tạo bài mới";
    Layout = "~/Views/Shared/_Layout_Admin.cshtml";
}

@section Header
{

}
@section ToolbarSection{
    @Html.X().Button().Text("Lưu").ID("btnSave").Disabled(true).Icon(Icon.Disk).DirectEvents(de =>
                                                                                            {
                                                                                                de.Click.Url = Url.Action("CreateNews");
                                                                                                de.Click.EventMask.ShowMask = true;
                                                                                                de.Click.FormID = "FormPanelCreateNews";
                                                                                            })
    @Html.X().Button().Text("Quay lại").Icon(Icon.ArrowLeft).Margins("0 0 0 10").Listeners(ls => ls.Click.Handler = "window.parent.location.reload();parentAutoLoadControl.close();")
}

@Html.X().FormPanel().ID("FormPanelCreateNews").Title("Create News").StyleSpec("position: static; z-index: 10;width: 100%;").Layout(LayoutType.Form).AutoScroll(true).Anchor("100% 100%").Listeners(
ls => ls.ValidityChange.Handler = "App.btnSave.setDisabled(!valid)").Items(
        Html.X().ComboBoxFor(m => m.GroupNewsId).FieldLabel("Nhóm").LabelWidth(130).Items(ViewBag.GNewsId).Width(400).StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().TextFieldFor(m => m.Name).Width(800).LabelWidth(130).FieldLabel("Tên").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().FileUploadField().FieldLabel("Ảnh").ID("UpImage").Icon(Icon.ImageAdd).Width(800).LabelWidth(130).StyleSpec("Margin: 15px 0px 0px 100px").Flex(1).AllowBlank(false),
        Html.X().TextAreaFor(m=>m.Content).ID("htmlEditor").Width(800).LabelWidth(130).FieldLabel("Nội dung").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().HtmlEditorFor(m=>m.Detail).Width(800).LabelWidth(130).FieldLabel("Chi tiết").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().DateFieldFor(m=>m.Date).Value(DateTime.Now).Width(400).LabelWidth(130).FieldLabel("Ngày tạo").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().TextFieldFor(m => m.Title).Width(800).LabelWidth(130).FieldLabel("Tựa đề").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().TextFieldFor(m => m.Keyword).Width(800).LabelWidth(130).FieldLabel("Từ khóa").StyleSpec("Margin: 15px 0px 0px 100px").Flex(1),
        Html.X().ComboBoxFor(m => m.CancerId).FieldLabel("Bệnh ung thư").LabelWidth(130).Items(ViewBag.CancerId).Width(400).StyleSpec("Margin: 15px 0px 100px 100px").Flex(1)
)